#include <vtkActor.h>
#include <vtkCamera.h>
#include <vtkConeSource.h>
#include <vtkSphereSource.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include<vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>

int main(int argc, char *argv[])
{
   vtkNew<vtkNamedColors>colors;

   vtkNew<vtkConeSource>cone;
   cone->SetHeight(3.0);
   cone->SetRadius(1.0);
   cone->SetResolution(10);

//创建映射器
   vtkNew<vtkPolyDataMapper> coneMapper;
   coneMapper->SetInputConnection(cone->GetOutputPort());
//创建actor
   vtkNew<vtkActor> coneActor;
   coneActor->SetMapper(coneMapper);
   coneActor->GetProperty()->SetColor(colors->GetColor3d("MistyRose").GetData());
//创建渲染器
   vtkNew<vtkRenderer>ren1;
   ren1->AddActor(coneActor);
   ren1->SetBackground(colors->GetColor3d("MidnightBlue").GetData());
//创建渲染窗口
   vtkNew<vtkRenderWindow>renWin;
   renWin->AddRenderer(ren1);
   renWin->SetSize(600,500);
   renWin->SetWindowName("Cone");

//创建交互窗口
    vtkNew<vtkRenderWindowInteractor>iren;
    iren->SetRenderWindow(renWin);

    iren->Initialize();

    renWin->Render();
    iren->Start();
   return EXIT_SUCCESS;
  
}